﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using mepostras.BLL;

namespace mepostras.BO
{
    public interface IMenuBo
    {
        /// <summary>
        /// Lấy menu theo alias
        /// </summary>
        /// <param name="alias"></param>
        /// <returns></returns>
        Menu GetByAlias(string alias);

        /// <summary>
        /// Lấy menu theo id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Menu Get(int id);

        /// <summary>
        /// Lấy menu theo id kèm theo article. Dùng trong admin
        /// </summary>
        /// <param name="id"></param>
        /// <param name="article"></param>
        /// <returns></returns>
        Menu Get(int id, out Article article);

        /// <summary>
        /// Lấy tất cả menu
        /// </summary>
        /// <returns></returns>
        TList<Menu> Get();

        /// <summary>
        /// Lấy danh sách menu theo ngôn ngữ
        /// </summary>
        /// <param name="language"></param>
        /// <returns></returns>
        TList<Menu> Get(string language);

        /// <summary>
        /// Lấy danh sách menu theo ngôn ngữ, vị trí
        /// </summary>
        /// <param name="position"></param>
        /// <param name="language"></param>
        /// <returns></returns>
        TList<Menu> Get(string position, string language);

        /// <summary>
        /// Lấy danh sách menu theo ngôn ngữ, loại menu
        /// </summary>
        /// <param name="menuType"></param>
        /// <param name="language"></param>
        /// <returns></returns>
        TList<Menu> GetByType(string menuType, string language);

        /// <summary>
        /// Lấy danh sách menu theo loại menu
        /// </summary>
        /// <param name="menuType"></param>
        /// <returns></returns>
        TList<Menu> GetByType(string menuType);

        /// <summary>
        /// Lấy danh sách menu theo ngôn ngữ, parent Id
        /// </summary>
        /// <param name="parentId"></param>
        /// <param name="language"></param>
        /// <returns></returns>
        TList<Menu> Get(int parentId, string language);

        /// <summary>
        /// Lấy danh sách menu gốc theo ngôn ngữ
        /// </summary>
        /// <param name="language"></param>
        /// <returns></returns>
        TList<Menu> GetRoot(string language);

        /// <summary>
        /// Lấy danh sách menu trừ menu hiện tại và các menu con của nó
        /// </summary>
        /// <param name="id"></param>
        /// <param name="language"></param>
        /// <returns></returns>
        TList<Menu> GetExceptMe(int id, string language);

        /// <summary>
        /// Xóa menu theo id
        /// </summary>
        /// <param name="id"></param>
        /// <param name="messageCode"></param>
        /// <returns></returns>
        bool Delete(int id, out string messageCode);

        /// <summary>
        /// Update menu
        /// </summary>
        /// <param name="menu"></param>
        /// <param name="messageCode"></param>
        /// <returns></returns>
        bool Update(Menu menu, out string messageCode);

        /// <summary>
        /// Update menu có article
        /// </summary>
        /// <param name="menu"></param>
        /// <param name="article"></param>
        /// <param name="messageCode"></param>
        /// <returns></returns>
        bool Update(Menu menu, Article article, out string messageCode);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="menu"></param>
        /// <param name="messageCode"></param>
        /// <returns></returns>
        bool Create(Menu menu, out string messageCode);
    }
}
